﻿namespace ExceptionExercise
{
    using System;

    public class InvalidRangeException<T> : ApplicationException
    {
        private T startRange;
        private T endRange;

        public InvalidRangeException(string errorMessage, T startRange, T endRange, Exception innerException)
            : base(errorMessage, innerException)
        {
            this.StartRange = startRange;
            this.EndRange = endRange;
        }

        public InvalidRangeException(string errorMessage, T startRange, T endRange)
            : this(errorMessage, startRange, endRange, null)
        {
        }

        public T StartRange
        {
            get
            {
                return this.startRange;
            }

            private set
            {
                this.startRange = value;
            }
        }

        public T EndRange
        {
            get
            {
                return this.endRange;
            }

            private set
            {
                this.endRange = value;
            }
        }
    }
}